Connecting to the Reader

The rm.Login must be called first to perform any reader management functions.

In case of fixed readers, the login information such as user name, password and secured mode are required for performing login operation. The secure mode parameter specifies that whether the mode of communication is HTTP or HTTPS. Based on this parameter, the internal communication between the client and the reader uses the specified transport interface.

The login Info is not required for the Hand held readers. But it is must to call the rm.Login method first prior to other reader management functions.

// create Reader management object instance

ReaderManagement rm = new ReaderManagement();

LoginInfo loginInfo = new LoginInfo();

loginInfo.HostName = m_pHostname;

loginInfo.UserName = "admin";

loginInfo.Password = "admin";

loginInfo.SecureMode = SECURE_MODE.HTTP;

// Login operation

try

{

    rm.Login(loginInfo, READER_TYPE.XR);

}

catch (OperationFailureException exception)

{

    Console.WriteLine("Login failed " + exception.Message);

}

Changing The Password

The rm.Login must be called first to perform this functions.

In case of fixed readers, the login information such as user name, oldpassword and newpassword are required for changing the password.

UserInfo userInfo = new UserInfo();

userInfo.Username = "admin";

userInfo.OldPassword = "change";

userInfo.NewPassword = "newpassword";

// change password operation

try

{

    rm.ChangePassword(userInfo);

}

catch (OperationFailureException exception)

{

    Console.WriteLine("change password failed " + exception.Message);

}